{extend name="public/pure"}

{block name="style"}
<title>伊川乡党建</title>
<link rel="stylesheet" href="/home/css/index/index.css">
<link rel="stylesheet" href="/home/css/common/animate.min.css">
{/block}

{block name="body"}
<div class="scroll" style="position:absolute; overflow:scroll; -webkit-overflow-scrolling: touch; top:0; left:0; bottom:0; right:0">
    <div class="top-bar">
        {eq name="$visit" value="1"}
        <a class="top-bar-user" href="#">
            <img src="/home/images/index/user.png">游客
        </a>
        {else/}
        <a class="top-bar-user" href="{:Url('Person/index')}">
            <img src="/home/images/index/user.png">{$info.name}
        </a>
        {/eq}
        <span class="top-bar-exit">退 出</span>
    </div>
    <img class="banner" src="/home/images/index/banner.png">
    <div class="modal-option">
        <ul>
            <a href="{:Url('Regulation/index')}">
                <img src="/home/images/index/icon_1.png" alt="村规民约">
                <span>村规民约</span>
            </a>
            <a href="{:Url('Structure/index')}">
                <img src="/home/images/index/icon_2.png" alt="组织架构">
                <span>组织架构</span>
            </a>
            <a href="{:Url('Party/index')}">
                <img src="/home/images/index/icon_3.png" alt="党务公开">
                <span>党务公开</span>
            </a>
                <a href="{:Url('Country/index')}">
                <img src="/home/images/index/icon_4.png" alt="美丽乡村">
                <span>美丽乡村</span>
            </a>
        </ul>
    </div>
    <div class="line"></div>

    <div class="content">
        <div class="content-commend">精品推荐</div>
        <div class="list basic">
            {empty name="$msg"}
             <div class="default"><img src="/home/images/common/nomessage.png"></div>
            {else/}
            <ul>
                {volist name="msg" id="mm"}
                {if condition="$mm.class eq 1"}
                <a href="{:Url('Regulation/detail?id='.$mm['id'])}">
                {elseif condition="$mm.class eq 2"}
                    <a href="{:Url('Party/detail?id='.$mm['id'])}">
                {else/}
                        <a href="{:Url('Country/detail?id='.$mm['id'])}">
                {/if}
                    <img src="{$mm.front_cover|get_covers='path'}">
                    <p>{$mm.title}</p>
                    <span>{if condition="$mm.class eq 1"}【村规民约】{elseif condition="$mm.class eq 2"}【党务公开】{else/}【美丽乡村】{/if}{$mm.publisher}</span>
                    <span>{$mm.create_time|time_format='Y-m-d'}</span>
                </a>
                {/volist}
            </ul>
            {/empty}
        </div>
    </div>
</div>

<div class="mask"></div>
<div class="mask-content animated">
    <img src="/home/images/index/warning.png" class="mask-warning">
    <img src="/home/images/index/mask.png" class="mask-bg">
    <span class="mask-question">是否确认退出？</span>
    <div class="mask-button-confirm">确定</div>
    <div class="mask-button-cancel">取消</div>
</div>



{/block}

{block name="script"}
<script>
    var overscroll = function(el) {
        el.addEventListener('touchstart', function() {
            var top = el.scrollTop
                    , totalScroll = el.scrollHeight
                    , currentScroll = top + el.offsetHeight;
            if(top === 0) {
                el.scrollTop = 1;
            } else if(currentScroll === totalScroll) {
                el.scrollTop = top - 1;
            }
        });
        el.addEventListener('touchmove', function(evt) {
            if(el.offsetHeight < el.scrollHeight)
                evt._isScroller = true;
        });
    }

    overscroll(document.querySelector('.scroll'));
    document.body.addEventListener('touchmove', function(evt) {
        if(!evt._isScroller) {
            evt.preventDefault();
        }
    });

    $(".top-bar-exit").off().on("click",function(){
        $(".mask").show();
            $(".mask-content").removeClass("bounceOut").addClass("fadeInDown").show();
    })
    $(".mask-button-cancel").off().on("click",function(){
        $(".mask").hide();
        $(".mask-content").removeClass("bounceIn").addClass("bounceOut").hide();
    })

    $(".mask-button-confirm").off().on("click",function(){
        $(".mask").hide();
        $(".mask-content").removeClass("bounceIn").addClass("bounceOut").hide();
        window.location.replace("{:Url('Verify/logout')}");
    })
</script>
{/block}